package android.tvtt.utils;

import android.util.Log;

/**
 * 
 * @author MinhThinh
 * @created May 30, 2013 11:06:27 AM
 */
public class DebugLog {

    /**
     * 
     * @author MinhThinh
     * @return void
     * @edited May 30, 2013 11:06:18 AM
     */
    public static void d(String message) {
        if (Constant.IS_DEBUG_MODE) {
            String fullClassName = Thread.currentThread().getStackTrace()[3]
                    .getClassName();
            String className = fullClassName.substring(fullClassName
                    .lastIndexOf(".") + 1);
            String methodName = Thread.currentThread().getStackTrace()[3]
                    .getMethodName();
            int lineNumber = Thread.currentThread().getStackTrace()[3]
                    .getLineNumber();
            //
            // Log.d(className, message + "---" + fullClassName + "." +
            // methodName
            // + "():" + lineNumber);

            Log.d(className, message + "---line:" + lineNumber);
        }
    }

    /**
     * 
     * @author MinhThinh
     * @return void
     * @edited May 30, 2013 11:06:18 AM
     */
    public static void e(String message) {
        if (Constant.IS_DEBUG_MODE) {
            String fullClassName = Thread.currentThread().getStackTrace()[3]
                    .getClassName();
            String className = fullClassName.substring(fullClassName
                    .lastIndexOf(".") + 1);
            String methodName = Thread.currentThread().getStackTrace()[3]
                    .getMethodName();
            int lineNumber = Thread.currentThread().getStackTrace()[3]
                    .getLineNumber();
            //
            // Log.e(className, message + "---" + fullClassName + "." +
            // methodName
            // + "():" + lineNumber);
            Log.e(className, message + "---line:" + lineNumber);
        }
    }
}